package cn.iocoder.yudao.module.blog.dal.mysql.spacelike;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.spacelike.BlogSpaceLikeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.spacelike.vo.*;

/**
 * 动态点赞 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogSpaceLikeMapper extends BaseMapperX<BlogSpaceLikeDO> {

    default PageResult<BlogSpaceLikeDO> selectPage(BlogSpaceLikePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogSpaceLikeDO>()
                .eqIfPresent(BlogSpaceLikeDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(BlogSpaceLikeDO::getSpaceId, reqVO.getSpaceId())
                .orderByDesc(BlogSpaceLikeDO::getId));
    }

    default List<BlogSpaceLikeDO> selectList(BlogSpaceLikeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogSpaceLikeDO>()
                .eqIfPresent(BlogSpaceLikeDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(BlogSpaceLikeDO::getSpaceId, reqVO.getSpaceId())
                .orderByDesc(BlogSpaceLikeDO::getId));
    }

}
